-- GENERATED SPELL FOR [Atal'ai Deathwalker] --


function spell0_5271(pUnit, Event) --@Fear,n/a--
pUnit:FullCastSpellOnTarget(12096,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_5271', 9500, 1)
end

function spell1_5271(pUnit, Event) --@Shadow Word: Pain,n/a--
pUnit:FullCastSpellOnTarget(11639,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_5271', 18000, 1)
end

function spell2_5271(pUnit, Event) --@Summon Atal\'ai Deathwalker\'s Spirit,Self--
pUnit:FullCastSpellOnTarget(12095,pUnit)
pUnit:RegisterEvent('Sorts_5271', 15274, 1)
end

function Sorts_5271(pUnit, Event)
local choix_sorts_5271 = math.random(0, 2)
if choix_sorts_5271 == 0 then
pUnit:RegisterEvent('spell0_5271', 1, 1)
end
if choix_sorts_5271 == 1 then
pUnit:RegisterEvent('spell1_5271', 1, 1)
end
if choix_sorts_5271 == 2 then
pUnit:RegisterEvent('spell2_5271', 1, 1)
end
end

function mob5271_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_5271', math.random(1500, 3000), 1)
end

function mob5271_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5271_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5271_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(5271, 1, 'mob5271_Action')
RegisterUnitEvent(5271, 2, 'mob5271_Leave')
RegisterUnitEvent(5271, 3, 'mob5271_Kill')
RegisterUnitEvent(5271, 4, 'mob5271_Die')
